<template>
	<view class="chooseImg">
		<image :src="xkImg.homeImage" mode="widthFix" style="height: 280rpx; margin-bottom: 20rpx;width: 662rpx;"
			@click="toPages(xkImg)"></image>
		<image :src="nmImg.homeImage" mode="widthFix" style="height: 280rpx;width: 662rpx;" @click="toPages(nmImg)">
		</image>
	</view>
</template>

<script>
	import {
		request
	} from "../../../util/api";
	export default {
		data() {
			return {
				xkImg: {
					homeImage: "",
					url: ""
				},
				nmImg: {
					homeImage: "",
					url: ""
				},
			}
		},
		created() {
			this.getData()
		},
		methods: {
			// 获取选科要求和模拟填报数据
			getData() {
				request({
					url: '/system/wx/CompassAppExplore/list',
					method: "get",
					token: true,
					platfom: 'weixin'
				}).then(res => {
					const img = res
					for (let itemTitle of img) {
						if (itemTitle.title === '选科要求') {
							this.xkImg.homeImage = itemTitle.homeImage
							this.xkImg.url = itemTitle.url
						}
						if (itemTitle.title === '模拟填报') {
							this.nmImg.homeImage = itemTitle.homeImage
							this.nmImg.url = itemTitle.url
						}
					}
				})
			},
			toPages(val) {
				this.$u.route({
					url: val.url,
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.choose {}

	.chooseImg {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-bottom: 40rpx;
	}
</style>
